<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
	</body>
	<script type="text/javascript">
		function getDayOfWeek1(date) {
			var str = "";
			var week = new Date(date).getDay();
			if (week == 0) {
				str = "星期日";
			} else if (week == 1) {
				str = "星期一";
			} else if (week == 2) {
				str = "星期二";
			} else if (week == 3) {
				str = "星期三";
			} else if (week == 4) {
				str = "星期四";
			} else if (week == 5) {
				str = "星期五";
			} else if (week == 6) {
				str = "星期六";
			}
			console.log(str)
			return str;
		}
		getDayOfWeek1(new Date()); // 星期三

		function getDayOfWeek2(date) {
			var arr = new Array("日", "一", "二", "三", "四", "五", "六");
			var week = new Date(date).getDay();
			var str = "星期" + arr[week];
			console.log(str)
			return str;
		}
		getDayOfWeek2(new Date()); // 星期三


		function getDayOfWeek3(date) {
			var str = "星期" + "日一二三四五六".charAt(new Date(date).getDay());
			console.log(str)
			return str;
		}
		getDayOfWeek3('2022-8-11');
	</script>
</html>
